package jzoffer;

/**
 * @author MaoLin Wang
 * @date 2020/10/7 9:07 上午
 */
public class 二进制1的个数 {
    public static int count1(int n){
        int count=0;
        while (n!=0){
            count+=n&1;
            n>>>=1;
        }
        return count;
    }

    public static void main(String[] args) {
        System.out.println(count1(1));
    }
}
